const cloud = require('wx-server-sdk');
cloud.init();
const STATUS_NAME = ['学生', '老师', '教务', '辅导员'];
const STATUS_NAME_EN = ['student', 'teacher', 'admin', 'instructor'];
exports.main = async (event) => {
  const db = cloud.database()
  var res = (await db.collection(STATUS_NAME_EN[event.status]).where({ code: event.code }).get()).data[0]
  return res
}
